package com.demo.day509;

import java.util.Scanner;

/**
 * @Auther: 86176
 * @Date: 2021/5/9 - 05 - 09 - 21:26
 * @version: 1.0
 */
public class StudentManager {

    Action action = new Action();


    public void run() {

        Scanner scanner = new Scanner(System.in);

        boolean login = true;

        while (login) {
            System.out.println("====================");
            System.out.println("请输入您需要使用的功能：");
            System.out.println("1、查看所有学生信息。");
            System.out.println("2、查看学生信息。");
            System.out.println("3、更改学生信息");
            System.out.println("4、增加学生信息");
            System.out.println("5、删除学生信息");
            System.out.println("6、退出");
            System.out.println("====================");
            int option = scanner.nextInt();

            switch (option) {
                case 1:
                    action.ShowStudent();
                    break;
                case 2:
                    System.out.println("请输入想要查看学生的学号");
                    String StudentNum = scanner.next();
                    action.ShowStudent(StudentNum);
                    break;
                case 3:
                    System.out.println("请输入想要更改学生的学号");
                    String StudentNum1 = scanner.next();
                    action.ChangeInformation(StudentNum1,scanner);
                    break;
                case 4:
                    action.AddInformation(scanner);
                    break;
                case 5:
                    System.out.println("请输入想要删除学生的学号");
                    String StudentNum3 = scanner.next();
                    action.ReduceInformation(StudentNum3);
                    break;
                case 6:
                    action.exit();
                    break;
            }

        }
    }


}
